package one.stand.controller;

import one.stand.model.ResultModel;
import one.stand.request.CompanyRequest;
import one.stand.request.GoodSpecRequest;
import one.stand.request.GoodsRequest;
import one.stand.request.GoodstypeRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 产品信息查询
 * @author Administrator
 */
@RestController
@RequestMapping("/goods")
public class GoodsController extends BaseController {

    /**
     * 查询公司信息
     */
    @PostMapping("/getCompanyInfo")
    public ResultModel getCompanyInfo(@RequestBody CompanyRequest companyRequest){
        return goodsService.getCompanyInfo(companyRequest);
    }

    /**
     * 根据公司查询产品分类
     */
    @PostMapping("/getGoodsType")
    public ResultModel getGoodsType(@RequestBody GoodstypeRequest goodstypeRequest){
        return goodsService.getGoodsType(goodstypeRequest);
    }

    /**
     * 根据产品分类查询产品
     */
    @PostMapping("/getGoodsList")
    public ResultModel getGoodsList(@RequestBody GoodsRequest goodsRequest){
        return goodsService.getGoodsList(goodsRequest);
    }

    /**
     * 根据产品查询规格
     */
    @PostMapping("/getGoodSpec")
    public ResultModel getGoodSpec(@RequestBody GoodSpecRequest goodSpecRequest){
        return goodsService.getGoodSpec(goodSpecRequest);
    }

    /**
     * 产品详情
     */
    @PostMapping("/getGoodsInfo")
    public ResultModel getGoodsInfo(@RequestBody GoodsRequest goodsRequest){
        return goodsService.getGoodsInfo(goodsRequest);
    }

    @PostMapping("/goodsCard")
    public ResultModel goodsCard(@RequestBody GoodSpecRequest request){
        return goodsService.goodsCard(request);
    }
}
